package com.aube.push;

import android.content.Context;

import com.asha.vrlib.texture.SystemProperties;
import com.huyn.baseframework.utils.Utils;

/**
 * Created by hill on 16/9/18.
 */
public class PushPhoneModel {
    private static final String TAG = "PushPhoneModel";

    private static PushPhoneModel mphonemodel;
    private Context mContext;
    private String mPhoneModel;

    public static PushPhoneModel getInstance(Context context) {
        if (null == mphonemodel) {
            mphonemodel = new PushPhoneModel(context);
        }
        return mphonemodel;
    }

    public PushPhoneModel(Context context) {
        mContext = context;
        getPhoneModel();
    }

    private void getPhoneModel() {
        mPhoneModel = SystemProperties.get("ro.build.fingerprint");
        Utils.Log(Utils.LogType.DEBUG, TAG, "PhoneModel is " + mPhoneModel);
    }

    public boolean isXiaomi() {
        if(mPhoneModel == null || mPhoneModel.equals(""))
            return false;

        if(mPhoneModel.toLowerCase().contains("xiaomi")) {
            return true;
        } else {
            return false;
        }
    }
}
